# -*- coding:UTF-8 -*-
import time

def time_deco(func):
    def wrapper(*args,**kwargs):
        start_time = time.time()
        f = func(*args,**kwargs)
        cost_time = time.time() - start_time
        print('耗时：{}'.format(cost_time))
        return f
    return wrapper

@time_deco
def test_1():
    print('this is a test')
    time.sleep(2)

if __name__ == '__main__':
    test_1()
